Retrieving Files
Introduction
The REST API endpoint GET /api/v2/document/{id}/file may be used to retrieve a file using the GUID of the file.
The GUID of the file may be already be known or it may be obtained via the document metadata search API GET /api/v2/document as described in the Assetic Knowledge Base article Document Metadata Search. Alternatively the document GUID may have been obtained as part of a larger process such as downloading files linked to a given work order. In that scenario the Assetic REST API endpoint GET /api/v2/workorder/{id} is first be used to get a list of documents associated with the work order.
Sample Request
https://XXX.assetic.net/api/v2/document/b6b99863-2a29-e611-9459-06edd62954d7/file
Response
File content
The response body is the document content, which may be saved as a file.
File Name
The response headers include the header "Content-Disposition". This contains the filename of the document. The content of this particular header is formatted as "attachment; filename=xxx.txt" where "xxx.txt" is the name of the file
Script Sample
For an example on how to script the retrieval of files from the Assetic cloud system via API call, refer to this article on the Integration SDK section.